from django.shortcuts import render
import json

# Create your views here.
def get_post_json_param(request, *keywords):
    req = json.loads(request.body)
    result = []
    for i in keywords:
        if request.method == 'POST':
            try:
                result.append(int(req.get(i, None)))
            except (ValueError, TypeError):
                result.append(req.get(i, None))
        else:
            result.append(None)
    return result